package com.qf.proxy.staticproxy.demo1;

/**
 * @author lwc
 * @date 2021/10/27 11:29
 * @Description
 */
public class Intermediary implements House {

    //定义一个真实对象
    private HouseOwner houseOwner;
    //创建构造方法
    public Intermediary() {
    }

    public Intermediary(HouseOwner houseOwner) {
        this.houseOwner = houseOwner;
    }
    //增强真实对象的方法
    @Override
    public void rent() {

        before();
        houseOwner.rent();
        after();
    }

    public void before(){
        System.out.println("招租启示");
    }
    public void after(){
        System.out.println("维修");
        System.out.println("转租");
    }


}
